cmake_minimum_required(VERSION 3.8)
project(ros2_drone_cpp)
set(CMAKE_CXX_STANDARD 17)  # ROS2 Humble要求C++17



add_compile_options(-Wno-unused-parameter)
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(serial REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rcl REQUIRED)
find_package(std_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(libstatistics_collector REQUIRED)
find_package(sensor_msgs REQUIRED)

include_directories(${CMAKE_SOURCE_DIR}/include/ros2_drone_cpp)
include_directories(/opt/ros/humble/include/rclcpp/)
include_directories(/opt/ros/humble/include/rcl/)
include_directories(/opt/ros/humble/include/rcutils/)
include_directories(/opt/ros/humble/include/rcl_yaml_param_parser/)
include_directories(/opt/ros/humble/include/rosidl_runtime_c/)
include_directories(/opt/ros/humble/include/rosidl_typesupport_interface/)
include_directories(/opt/ros/humble/include/rcpputils/)
include_directories(/opt/ros/humble/include/builtin_interfaces/)
include_directories(/opt/ros/humble/include/rmw/)
include_directories(/opt/ros/humble/include/rosidl_runtime_cpp/)
include_directories(/opt/ros/humble/include/tracetools/)
include_directories(/opt/ros/humble/include/rcl_interfaces/)
include_directories(/opt/ros/humble/include/libstatistics_collector/)
include_directories(/opt/ros/humble/include/statistics_msgs/)
include_directories(/opt/ros/humble/include/std_msgs/)
include_directories(/opt/ros/humble/include/geometry_msgs/)
include_directories(/opt/ros/humble/include/sensor_msgs/)





include_directories(/usr/local/include/serial/)

link_directories(/opt/ros/humble/lib/)

link_directories(/usr/local/lib/)


add_executable(Serial32 src/Serial32.cpp src/main.cpp)



target_link_libraries(Serial32 rclcpp rcutils serial ${rcl_LIBRARIES}  libstatistics_collector::libstatistics_collector )

ament_target_dependencies(Serial32
  rclcpp rcl serial geometry_msgs sensor_msgs libstatistics_collector
)


install(TARGETS
  Serial32
  DESTINATION lib/${PROJECT_NAME})



ament_package()
